package com.zheng.controller;


import com.zheng.mvcframework.annotations.MyAutowired;
import com.zheng.mvcframework.annotations.MyController;
import com.zheng.mvcframework.annotations.MyRequestMapping;
import com.zheng.mvcframework.annotations.Security;
import com.zheng.service.IDemoService;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@MyController
@MyRequestMapping("/demo")
@Security("hao")
public class DemoController {


    @MyAutowired
    private IDemoService demoService;



    @MyRequestMapping("/queryByZheng")
    public void queryByZheng(String userName,HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.getWriter().write("权限访问成功:"+demoService.get(userName));
    }

    @MyRequestMapping("/queryByHao")
    @Security("hao")
    public void queryByHao(String userName,HttpServletRequest request, HttpServletResponse response) throws IOException {
        response.getWriter().write("权限访问成功:"+demoService.get(userName));
    }
}
